package net.whg.java.callback;

public class EventSource {

    private Callback callback;

    //注册回调接口
    public void registerCallback(Callback callback) {
        this.callback = callback;
    }

    //模拟事件发生
    public void delete(String id) {
        if (callback != null) {
            callback.log(id);
        }
        System.out.println("模拟删除数据：" + id);
    }
}
